package generic;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

/**
 * @program: javase
 * @description: 自定义泛型类
 * @author: lld
 * @create: 2020-11-09 20:42
 **/
public class Demo1<E> {
    E name;
    int pwd;
//    public <T> T get(){
//
//    }
    public static void main(String[] args) {
        Demo1<String> demo1=new Demo1<>();
        System.out.println(demo1.name="kkk");
        System.out.println(get("lll"));
        System.out.println(get(111));
        System.out.println(get(111.0));


    }
    //泛型方法
    public static <T> T get(T t){
        return t;
    }
}

